/*
 * Copyright 2002-2016 the Beijing Brain Technology co.,LTD http://www.bris.cn/
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bris.niosocket.mapping;

import org.springframework.core.Ordered;

import com.bris.niosocket.message.impl.RequestMessage;
import com.bris.niosocket.message.impl.ResponseMessage;

/**
 * 业务处理拦截器</br>
 * 在handler处理前或处理后执行,可用于业务流程的处理扩展</br>
 * 2016年2月18日</br>
 * @author xunaidong
 * @since 1.0.0
 */
public interface HandlerInterceptor extends Ordered{
	/**
	 * 执行处理器之前调用</br>
	 * @author xunaidong 
	 * @param request
	 * @param response
	 * @param handler
	 * @throws Exception 
	 * @since 1.0.0
	 */
	void preHandler(RequestMessage request,ResponseMessage response,Object handler) throws Exception;
	/**
	 * 执行处理器之后调用<br/> 
	 * @author xunaidong 
	 * @param request
	 * @param response
	 * @param handler
	 * @throws Exception 
	 * @since 1.0.0
	 */
	void aftertHandler(RequestMessage request,ResponseMessage response,Object handler) throws Exception;

}
